#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "prexec.h"

mainwindow::mainwindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::mainwindow)
{
    ui->setupUi(this);

    connect(ui->actionRun, SIGNAL(triggered()), this, SLOT(onRun()));
}

void mainwindow::onRun()
{
    T_StringList tsl;

    QString text = ui->plainTextEdit->document()->toPlainText();
    QStringList sl = text.split("\n");
    foreach (QString s, sl)
        tsl.AddString(T_String(s.data_ptr()));

    bool er = true;
    TParentParam par;
    TPrSetting sets;
    int serr, errst;
    RunProlog(&tsl, &er, &par, &set, serr, errst);
}

mainwindow::~mainwindow()
{
    delete ui;
}
